// 引入 color 模块
@use "sass:color";
// 引入 math 模块
@use "sass:math";
// 引入 map 模块
@use "sass:map";

@import url(./iconfont.css);

// 基础变量
$primary-color: #007bff;
$secondary-color: #6c757d;
$success-color: #28a745;
$danger-color: #dc3545;
$warning-color: #ffc107;
$info-color: #17a2b8;
$light-color: #f8f9fa;
$dark-color: #343a40;
$white: #fff;
$black: #000;
// 基础字体大小，移动端适当减小
$font-size-base: 14px;
$font-size-sm: 12px;
$font-size-lg: 16px;
$border-radius-base: 4px;
$border-radius-lg: 0.3rem;
$border-radius-sm: 0.2rem;
$transition-duration: 0.3s;
$breakpoints: (
    xs: 0,
    sm: 576px,
    md: 768px,
    lg: 992px,
    xl: 1200px
);
// 新增变量
$default-border-color: #ddd;
$default-box-shadow-color: rgba(0, 0, 0, 0.1);
$default-padding: 0.75rem;

// 定义 mixin
@mixin transition-all {
    transition: all $transition-duration ease-in-out;
}

@mixin btn-styles($bg-color, $hover-bg-color, $active-bg-color, $text-color) {
    color: $text-color;
    background-color: $bg-color;
    border-color: $bg-color;

    &:hover {
        background-color: $hover-bg-color;
        border-color: $hover-bg-color;
    }

    &:focus {
        box-shadow: 0 0 0 0.2rem rgba(math.floor(red($bg-color)), math.floor(green($bg-color)), math.floor(blue($bg-color)), 0.5);
    }

    &:active {
        background-color: $active-bg-color;
        border-color: $active-bg-color;
    }
}

// 基础样式
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: $font-size-base;
    line-height: 1.5;
    color: $dark-color;
    background-color: $light-color;
    margin: 0;
    padding: 0;
    // 禁止移动端双击缩放
    touch-action: manipulation;

    a {
        color: $primary-color;
        text-decoration: none;

        &:hover {
            color: darken($primary-color, 10%);
            text-decoration: underline;
        }
    }
}

// 按钮样式增强
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: $font-size-base;
    line-height: 1.5;
    border-radius: $border-radius-base;
    @include transition-all;

    &:hover {
        text-decoration: none;
    }

    &:focus {
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

    &:disabled,
    &.disabled {
        opacity: 0.65;
        pointer-events: none;
    }

    // 主要按钮
    &-primary {
        @include btn-styles($primary-color,
            color.adjust($primary-color, $lightness: -10%),
            color.adjust($primary-color, $lightness: -15%),
            $white );
    }

    // 次要按钮
    &-secondary {
        @include btn-styles($secondary-color,
            color.adjust($secondary-color, $lightness: -10%),
            color.adjust($secondary-color, $lightness: -15%),
            $white );
    }

    // 成功按钮
    &-success {
        @include btn-styles($success-color,
            color.adjust($success-color, $lightness: -10%),
            color.adjust($success-color, $lightness: -15%),
            $white );
    }

    // 危险按钮
    &-danger {
        @include btn-styles($danger-color,
            color.adjust($danger-color, $lightness: -10%),
            color.adjust($danger-color, $lightness: -15%),
            $white );
    }

    // 警告按钮
    &-warning {
        @include btn-styles($warning-color,
            color.adjust($warning-color, $lightness: -10%),
            color.adjust($warning-color, $lightness: -15%),
            #212529);
    }

    // 信息按钮
    &-info {
        @include btn-styles($info-color,
            color.adjust($info-color, $lightness: -10%),
            color.adjust($info-color, $lightness: -15%),
            $white );
    }

    // 按钮尺寸
    &-lg {
        padding: 0.5rem 1rem;
        font-size: $font-size-lg;
        line-height: 1.5;
        border-radius: $border-radius-lg;
    }

    &-sm {
        padding: 0.25rem 0.5rem;
        font-size: $font-size-sm;
        line-height: 1.5;
        border-radius: $border-radius-sm;
    }

    // 移动端按钮适当增大点击区域
    @media (max-width: map.get($breakpoints, sm)) {
        padding: 0.5rem 1rem;
        font-size: $font-size-lg;
    }

    &.loading {
        position: relative;
        pointer-events: none;

        &::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: 1rem;
            height: 1rem;
            margin-top: -0.5rem;
            margin-left: -0.5rem;
            border: 0.2em solid currentColor;
            border-radius: 50%;
            border-right-color: transparent;
            border-top-color: transparent;
            animation: btn-loading-spinner 0.75s linear infinite;
        }
    }
}

@keyframes btn-loading-spinner {
    to {
        transform: rotate(360deg);
    }
}

// 输入框样式增强
.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: $font-size-base;
    font-weight: 400;
    line-height: 1.5;
    color: $dark-color;
    background-color: $white;
    background-clip: padding-box;
    border: 1px solid $default-border-color;
    border-radius: $border-radius-base;
    @include transition-all;

    &:focus {
        color: $dark-color;
        background-color: $white;
        border-color: #80bdff;
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

    &::placeholder {
        color: $secondary-color;
        opacity: 1;
    }

    &:disabled,
    &[readonly] {
        background-color: #e9ecef;
        opacity: 1;
    }

    // 验证状态
    &.is-valid {
        border-color: $success-color;
        padding-right: calc(1.5em + 0.75rem);
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right calc(0.375em + 0.1875rem) center;
        background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);

        &:focus {
            border-color: $success-color;
            box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
        }
    }

    &.is-invalid {
        border-color: $danger-color;
        padding-right: calc(1.5em + 0.75rem);
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right calc(0.375em + 0.1875rem) center;
        background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);

        &:focus {
            border-color: $danger-color;
            box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
        }
    }

    // 输入框尺寸
    &-lg {
        padding: 0.5rem 1rem;
        font-size: $font-size-lg;
        line-height: 1.5;
        border-radius: $border-radius-lg;
    }

    &-sm {
        padding: 0.25rem 0.5rem;
        font-size: $font-size-sm;
        line-height: 1.5;
        border-radius: $border-radius-sm;
    }

    // 移动端输入框适当增大
    @media (max-width: map.get($breakpoints, sm)) {
        padding: 0.5rem;
        font-size: $font-size-lg;
    }
}

// 卡片样式
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: $white;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: $border-radius-base;

    .card-header {
        padding: $default-padding 1.25rem;
        margin-bottom: 0;
        background-color: rgba(0, 0, 0, 0.03);
        border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    }

    .card-body {
        flex: 1 1 auto;
        padding: 1.25rem;
    }

    .card-footer {
        padding: $default-padding 1.25rem;
        background-color: rgba(0, 0, 0, 0.03);
        border-top: 1px solid rgba(0, 0, 0, 0.125);
    }

    // 移动端卡片内边距适当减小
    @media (max-width: map.get($breakpoints, sm)) {

        .card-header,
        .card-body,
        .card-footer {
            padding: 0.5rem;
        }
    }
}

// 导航栏样式增强
.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background-color: $light-color;

    &.fixed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999999;
    }

    &.navbar-dark {
        background-color: $dark-color;
        color: $light-color;

        .navbar-brand {
            color: $light-color;

            &:hover,
            &:focus {
                color: $white;
            }
        }

        .navbar-nav .nav-link {
            color: rgba($light-color, 0.5);

            &:hover,
            &:focus {
                color: rgba($light-color, 0.75);
            }

            &.active {
                color: $light-color;
            }
        }
    }

    .navbar-brand {
        display: inline-block;
        padding-top: 0.3125rem;
        padding-bottom: 0.3125rem;
        margin-right: 1rem;
        font-size: $font-size-lg;
        line-height: inherit;
        white-space: nowrap;
    }

    .navbar-nav {
        display: flex;
        flex-direction: column;
        padding-left: 0;
        margin-bottom: 0;
        list-style: none;

        .nav-item {
            .nav-link {
                display: block;
                padding: 0.5rem 1rem;

                &.on {
                    color: $primary-color;
                }
            }
        }
    }

    @each $name, $breakpoint in $breakpoints {
        @if $name !="xs" {
            &.navbar-expand-#{$name} {
                flex-flow: row nowrap;
                justify-content: flex-start;

                .navbar-nav {
                    flex-direction: row;

                    .nav-item {
                        .nav-link {
                            padding-right: 0.5rem;
                            padding-left: 0.5rem;
                        }
                    }
                }
            }
        }
    }

    // 移动端导航栏切换为垂直布局
    @media (max-width: map.get($breakpoints, sm)) {
        flex-direction: column;
        align-items: flex-start;

        .navbar-nav {
            width: 100%;
        }

        .nav-item {
            .nav-link {
                padding: 0.5rem 0;
            }
        }
    }
}

// 网格系统增强
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;

    @each $name, $breakpoint in $breakpoints {
        @if $name !="xs" {
            @media (min-width: $breakpoint) {
                max-width: $breakpoint - 30px;
            }
        }
    }
}

.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col,
[class^="col-"],
[class*=" col-"] {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

@for $i from 1 through 12 {
    .col-#{$i} {
        flex: 0 0 math.percentage(math.div($i, 12));
        max-width: math.percentage(math.div($i, 12));
    }
}

@each $name, $breakpoint in $breakpoints {
    @if $name !="xs" {
        @media (min-width: $breakpoint) {
            @for $i from 1 through 12 {
                .col-#{$name}-#{$i} {
                    flex: 0 0 math.percentage(math.div($i, 12));
                    max-width: math.percentage(math.div($i, 12));
                    padding-right: 15px;
                    padding-left: 15px;
                }
            }
        }
    }
}

// 警报样式
.alert {
    position: relative;
    padding: $default-padding 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: $border-radius-base;

    &-primary {
        color: #004085;
        background-color: #cce5ff;
        border-color: #b8daff;
    }

    &-secondary {
        color: #383d41;
        background-color: #e2e3e5;
        border-color: #d6d8db;
    }

    &-success {
        color: #155724;
        background-color: #d4edda;
        border-color: #c3e6cb;
    }

    &-danger {
        color: #721c24;
        background-color: #f8d7da;
        border-color: #f5c6cb;
    }

    &-warning {
        color: #856404;
        background-color: #fff3cd;
        border-color: #ffeeba;
    }

    &-info {
        color: #0c5460;
        background-color: #d1ecf1;
        border-color: #bee5eb;
    }

    // 移动端警报内边距适当减小
    @media (max-width: map.get($breakpoints, sm)) {
        padding: 0.5rem;
    }
}

// 新增表单组件样式
// 单选框
.form-check-input[type="radio"] {
    border-radius: 50%;
}

// 下拉选择框
.custom-select {
    display: inline-block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 1.75rem 0.375rem 0.75rem;
    font-size: $font-size-base;
    font-weight: 400;
    line-height: 1.5;
    color: $dark-color;
    vertical-align: middle;
    background: $white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right 0.75rem center/8px 10px;
    border: 1px solid $default-border-color;
    border-radius: $border-radius-base;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    @include transition-all;

    &:focus {
        border-color: #80bdff;
        outline: 0;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

    // 移动端下拉选择框适当增大
    @media (max-width: map.get($breakpoints, sm)) {
        padding: 0.5rem;
        font-size: $font-size-lg;
    }
}

// 新增导航组件样式
// 面包屑导航
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: $default-padding 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: #e9ecef;
    border-radius: $border-radius-base;

    .breadcrumb-item {
        &+.breadcrumb-item {
            padding-left: 0.5rem;

            &::before {
                display: inline-block;
                padding-right: 0.5rem;
                color: $secondary-color;
                content: "/";
            }
        }

        &.active {
            color: $secondary-color;
        }
    }

    // 移动端面包屑导航内边距适当减小
    @media (max-width: map.get($breakpoints, sm)) {
        padding: 0.5rem;
        font-size: $font-size-sm;
    }
}

// 新增反馈组件样式
// 模态框
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;

    .modal-dialog {
        position: relative;
        width: auto;
        margin: 0.5rem;
        pointer-events: none;

        @media (min-width: map.get($breakpoints, sm)) {
            max-width: 500px;
            margin: 1.75rem auto;
        }

        .modal-content {
            position: relative;
            display: flex;
            flex-direction: column;
            width: 100%;
            pointer-events: auto;
            background-color: $white;
            background-clip: padding-box;
            border: 1px solid rgba(0, 0, 0, 0.2);
            border-radius: 0.3rem;
            outline: 0;

            .modal-header {
                display: flex;
                align-items: flex-start;
                justify-content: space-between;
                padding: 1rem 1rem;
                border-bottom: 1px solid #dee2e6;
                border-top-left-radius: 0.3rem;
                border-top-right-radius: 0.3rem;

                .modal-title {
                    margin-bottom: 0;
                    line-height: 1.5;
                }

                .close {
                    padding: 1rem 1rem;
                    margin: -1rem -1rem -1rem auto;
                    background-color: transparent;
                    border: 0;
                    font-size: 1.5rem;
                    font-weight: 700;
                    line-height: 1;
                    color: $black;
                    text-shadow: 0 1px 0 $white;
                    opacity: 0.5;
                    @include transition-all;

                    &:hover {
                        color: $black;
                        text-decoration: none;
                        opacity: 0.75;
                    }
                }
            }

            .modal-body {
                position: relative;
                flex: 1 1 auto;
                padding: 1rem;
            }

            .modal-footer {
                display: flex;
                flex-wrap: wrap;
                align-items: center;
                justify-content: flex-end;
                padding: 0.75rem;
                border-top: 1px solid #dee2e6;

                >* {
                    margin: 0.25rem;
                }
            }
        }
    }

    // 移动端模态框宽度调整
    @media (max-width: map.get($breakpoints, sm)) {
        .modal-dialog {
            margin: 0.5rem;
        }
    }
}

// 新增表格组件样式
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: $dark-color;
    border-collapse: collapse;

    th,
    td {
        padding: $default-padding;
        vertical-align: top;
        border-top: 1px solid #dee2e6;
    }

    thead th {
        vertical-align: bottom;
        border-bottom: 2px solid #dee2e6;
    }

    tbody+tbody {
        border-top: 2px solid #dee2e6;
    }

    // 条纹表格
    &-striped {
        tbody tr:nth-of-type(odd) {
            background-color: rgba(0, 0, 0, 0.05);
        }
    }

    // 带边框表格
    &-bordered {

        th,
        td {
            border: 1px solid #dee2e6;
        }

        thead th,
        thead td {
            border-bottom-width: 2px;
        }
    }

    // 移动端表格滚动显示
    @media (max-width: map.get($breakpoints, sm)) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

// 新增分页组件样式
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: $border-radius-base;

    .page-item {
        &:first-child {
            .page-link {
                margin-left: 0;
                border-top-left-radius: $border-radius-base;
                border-bottom-left-radius: $border-radius-base;
            }
        }

        &:last-child {
            .page-link {
                border-top-right-radius: $border-radius-base;
                border-bottom-right-radius: $border-radius-base;
            }
        }

        &.disabled {
            .page-link {
                color: $secondary-color;
                pointer-events: none;
                cursor: auto;
                background-color: $white;
                border-color: #dee2e6;
            }
        }

        &.active {
            .page-link {
                z-index: 3;
                color: $white;
                background-color: $primary-color;
                border-color: $primary-color;
            }
        }
    }

    .page-link {
        position: relative;
        display: block;
        padding: 0.5rem 0.75rem;
        margin-left: -1px;
        line-height: 1.25;
        color: $primary-color;
        background-color: $white;
        border: 1px solid #dee2e6;
        @include transition-all;

        &:hover {
            z-index: 2;
            color: #0056b3;
            text-decoration: none;
            background-color: #e9ecef;
            border-color: #dee2e6;
        }

        &:focus {
            z-index: 3;
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        }
    }

    // 移动端分页按钮适当增大
    @media (max-width: map.get($breakpoints, sm)) {
        .page-link {
            padding: 0.5rem 1rem;
            font-size: $font-size-lg;
        }
    }
}

// 定义动画
// 淡入动画
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

// 淡出动画
@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

// 缩放进入动画
@keyframes scaleIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

// 缩放退出动画
@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.5);
        opacity: 0;
    }
}

// 滑动进入动画（从下往上）
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

// 滑动退出动画（从上往下）
@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

// 动画类
.animate {
    animation-fill-mode: both;
}

.animate-fade-in {
    animation-name: fadeIn;
}

.animate-fade-out {
    animation-name: fadeOut;
}

.animate-scale-in {
    animation-name: scaleIn;
}

.animate-scale-out {
    animation-name: scaleOut;
}

.animate-slide-in-up {
    animation-name: slideInUp;
}

.animate-slide-out-down {
    animation-name: slideOutDown;
}

// 动画时长类
.animate-duration-1s {
    animation-duration: 1s;
}

.animate-duration-2s {
    animation-duration: 2s;
}

.animate-duration-3s {
    animation-duration: 3s;
}

// 动画延迟类
.animate-delay-1s {
    animation-delay: 1s;
}

.animate-delay-2s {
    animation-delay: 2s;
}

.animate-delay-3s {
    animation-delay: 3s;
}

// 动画次数类
.animate-infinite {
    animation-iteration-count: infinite;
}

// 主内容区域样式
.main-content {
    padding: 1rem; // 减少内边距
    max-width: 900px; // 让内容区域在小屏幕下占满宽度
    margin: 0 auto;
    overflow: hidden;
}

// 内容区域样式
#content {

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: #1a1a1a;
        font-weight: 600;
        line-height: 1.25;
        margin-top: 2rem;
        margin-bottom: 1rem;

        &::before {
            content: "";
            display: block;
            height: 60px;
            margin-top: -60px;
            visibility: hidden;
        }
    }

    p {
        margin-bottom: 1rem;
    }

    a {
        color: var(--primary-color);
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }

    blockquote {
        margin: 1rem 0;
        padding: 0.5rem 1rem;
        border-left: 4px solid var(--primary-color);
        background-color: #f9f9f9;
    }

    code {
        background-color: rgba(27, 31, 35, 0.05);
        padding: 0.2em 0.4em;
        border-radius: 3px;
        font-size: 85%;
        word-wrap: break-word; // 允许代码换行
    }

    pre {
        background-color: #2d2d2d;
        padding: 1rem;
        border-radius: 4px;
        overflow-x: auto; // 小屏幕下允许横向滚动

        code {
            background-color: transparent;
            color: #cccccc;
            padding: 0;
            font-size: 90%;
        }
    }
}

// 新增阴影样式
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem $default-box-shadow-color !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem $default-box-shadow-color !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem $default-box-shadow-color !important;
}

// 新增浮动样式
.float-left {
    float: left !important;
}

.float-right {
    float: right !important;
}

.float-none {
    float: none !important;
}

// 新增显示和隐藏样式
@each $name, $breakpoint in $breakpoints {
    @if $name !="xs" {
        @media (min-width: $breakpoint) {
            .d-#{$name}-none {
                display: none !important;
            }

            .d-#{$name}-block {
                display: block !important;
            }

            .d-#{$name}-inline {
                display: inline !important;
            }

            .d-#{$name}-inline-block {
                display: inline-block !important;
            }

            .d-#{$name}-flex {
                display: flex !important;
            }
        }
    }
}

// 新增文本对齐样式
.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

// 新增背景颜色样式
.bg-primary {
    background-color: $primary-color !important;
}

.bg-secondary {
    background-color: $secondary-color !important;
}

.bg-success {
    background-color: $success-color !important;
}

.bg-danger {
    background-color: $danger-color !important;
}

.bg-warning {
    background-color: $warning-color !important;
}

.bg-info {
    background-color: $info-color !important;
}

.bg-light {
    background-color: $light-color !important;
}

.bg-dark {
    background-color: $dark-color !important;
}

.bg-white {
    background-color: $white !important;
}

// 新增文本颜色样式
.text-primary {
    color: $primary-color !important;
}

.text-secondary {
    color: $secondary-color !important;
}

.text-success {
    color: $success-color !important;
}

.text-danger {
    color: $danger-color !important;
}

.text-warning {
    color: $warning-color !important;
}

.text-info {
    color: $info-color !important;
}

.text-light {
    color: $light-color !important;
}

.text-dark {
    color: $dark-color !important;
}

.text-white {
    color: $white !important;
}

// 标签页组件
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
    border-bottom: 1px solid #dee2e6;

    .nav-item {
        .nav-link {
            display: block;
            padding: 0.5rem 1rem;
            color: $primary-color;
            background-color: transparent;
            border: 1px solid transparent;
            border-top-left-radius: $border-radius-base;
            border-top-right-radius: $border-radius-base;
            @include transition-all;

            &:hover {
                border-color: #e9ecef #e9ecef #dee2e6;
                isolation: isolate;
            }

            &.active {
                color: $dark-color;
                background-color: $white;
                border-color: #dee2e6 #dee2e6 $white;
            }
        }
    }
}

.tab-content {
    .tab-pane {
        display: none;

        &.active {
            display: block;
        }
    }
}

// 进度条组件
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: $border-radius-base;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: $white;
    text-align: center;
    white-space: nowrap;
    background-color: $primary-color;
    transition: width 0.6s ease;

    &-striped {
        background-image: linear-gradient(45deg,
                rgba(255, 255, 255, 0.15) 25%,
                transparent 25%,
                transparent 50%,
                rgba(255, 255, 255, 0.15) 50%,
                rgba(255, 255, 255, 0.15) 75%,
                transparent 75%,
                transparent);
        background-size: 1rem 1rem;
    }

    &-animated {
        animation: progress-bar-stripes 1s linear infinite;
    }
}

@keyframes progress-bar-stripes {
    0% {
        background-position: 1rem 0;
    }

    100% {
        background-position: 0 0;
    }
}

// 响应式边距和内边距
@each $size in 0, 1, 2, 3, 4, 5 {
    @each $direction in t, b, l, r, x, y, a {
        @each $breakpoint, $value in $breakpoints {
            @if $breakpoint !="xs" {
                @media (min-width: $value) {
                    .m#{$direction}-#{$size} {
                        margin: if($direction ==a, $size * 0.25rem, null);
                        margin-top: if($direction ==t or $direction ==y, $size * 0.25rem, null);
                        margin-bottom: if($direction ==b or $direction ==y, $size * 0.25rem, null);
                        margin-left: if($direction ==l or $direction ==x, $size * 0.25rem, null);
                        margin-right: if($direction ==r or $direction ==x, $size * 0.25rem, null);
                    }

                    .p#{$direction}-#{$size} {
                        padding: if($direction ==a, $size * 0.25rem, null);
                        padding-top: if($direction ==t or $direction ==y, $size * 0.25rem, null);
                        padding-bottom: if($direction ==b or $direction ==y, $size * 0.25rem, null);
                        padding-left: if($direction ==l or $direction ==x, $size * 0.25rem, null);
                        padding-right: if($direction ==r or $direction ==x, $size * 0.25rem, null);
                    }
                }
            }
        }
    }
}

// 辅助功能增强
*:focus-visible {
    outline: 2px solid $primary-color;
    outline-offset: 2px;
}

// 对于不支持 focus-visible 的浏览器提供备用方案
*:focus:not(:focus-visible) {
    outline: none;
}

// 暗黑模式支持
@media (prefers-color-scheme: dark) {
    body {
        color: $light-color;
        background-color: $dark-color;
    }

    a {
        color: lighten($primary-color, 10%);

        &:hover {
            color: lighten($primary-color, 20%);
        }
    }

    .btn {
        &-primary {
            background-color: darken($primary-color, 10%);
            border-color: darken($primary-color, 10%);

            &:hover {
                background-color: darken($primary-color, 20%);
                border-color: darken($primary-color, 20%);
            }
        }

        // 其他按钮类型类似调整
    }

    .card {
        background-color: #444;
        border-color: #555;
    }

    // 其他组件类似调整
}

.enter-from {
    opacity: 0;
    transform: translateY(-20px);
}

.enter-to {
    opacity: 1;
    transform: translateY(0);
}

.enter-active {
    transition: all 0.3s ease;
}

.leave-from {
    opacity: 1;
    transform: translateY(0);
}

.leave-to {
    opacity: 0;
    transform: translateY(20px);
}

.leave-active {
    transition: all 0.3s ease;
}

/* 淡入淡出 */
.fade-enter-from,
.fade-leave-to {
    opacity: 0;
}

.fade-enter-to,
.fade-leave-from {
    opacity: 1;
}

.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.3s;
}

/* 缩放 */
.scale-enter-from,
.scale-leave-to {
    transform: scale(0);
}

.scale-enter-to,
.scale-leave-from {
    transform: scale(1);
}

.scale-enter-active,
.scale-leave-active {
    transition: transform 0.3s;
}

// 过渡动画基础样式
.enter-from,
.leave-to {
    opacity: 0;
    transform: translateY(20px);
}

.enter-to,
.leave-from {
    opacity: 1;
    transform: translateY(0);
}

.enter-active,
.leave-active {
    transition: all 0.3s ease;
}

// 输入框样式
.input {
    padding: 8px 12px;
    border: 1px solid $default-border-color;
    border-radius: $border-radius-base;
    width: 100%;
    box-sizing: border-box;
    @include transition-all;

    &:focus {
        border-color: #3498db;
        outline: none;
    }
}

// 模态框样式
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-container {
    background: $white;
    border-radius: $border-radius-base;
    min-width: 300px;
    max-width: 80%;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid $default-border-color;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    @include transition-all;

    &:hover {
        color: darken($dark-color, 10%);
    }
}

// 导航样式
.nav {
    display: flex;
    border-bottom: 1px solid $default-border-color;
}

.nav-item {
    padding: 12px 16px;
    cursor: pointer;
    @include transition-all;

    &.active {
        color: #3498db;
        border-bottom: 2px solid #3498db;
    }
}

// 下拉选择样式
.select {
    position: relative;

    &-selected {
        padding: 8px;
        border: 1px solid $default-border-color;
        cursor: pointer;
        @include transition-all;
    }

    &-options {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        border: 1px solid $default-border-color;
        background: $white;
        z-index: 10;
    }

    &-option {
        padding: 8px;
        cursor: pointer;
        @include transition-all;

        &:hover {
            background: #f5f5f5;
        }
    }
}

// 分页样式
.pagination {
    display: flex;
    gap: 4px;

    button {
        padding: 4px 8px;
        @include transition-all;

        &.active {
            background: #3498db;
            color: $white;
        }
    }
}

// 标签样式
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: $border-radius-base;
    background: #eee;
    @include transition-all;

    &-primary {
        background: #3498db;
        color: $white;
    }
}

// 进度条样式
.progress {
    height: 8px;
    background: #eee;
    border-radius: $border-radius-base;

    &-bar {
        height: 100%;
        background: #3498db;
        border-radius: $border-radius-base;
        transition: width 0.3s;
    }
}

// 表格样式
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;

    th,
    td {
        padding: 8px;
        border: 1px solid $default-border-color;
        text-align: left;
    }

    th {
        background: #f5f5f5;
    }
}

// 树形控件样式
.tree {
    user-select: none;

    &-node {
        margin-left: 16px;
    }

    &-node-content {
        padding: 4px;
        cursor: pointer;
        @include transition-all;

        &:hover {
            background: #f5f5f5;
        }
    }

    &-arrow {
        display: inline-block;
        margin-right: 4px;
        transition: transform 0.2s;

        &.expanded {
            transform: rotate(90deg);
        }
    }
}

// 消息提示样式
.message {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: $border-radius-base;
    box-shadow: 0 2px 8px $default-box-shadow-color;
    z-index: 9998;

    &.success {
        background: #4CAF50;
        color: $white;
    }

    &.error {
        background: #f44336;
        color: $white;
    }

    &.info {
        background: #2196F3;
        color: $white;
    }
}

// 日期选择器样式
.date-picker {
    position: relative;

    .date-input {
        padding: 8px;
        border: 1px solid $default-border-color;
        border-radius: $border-radius-base;
    }

    .calendar {
        position: absolute;
        top: 100%;
        left: 0;
        width: 240px;
        background: $white;
        border: 1px solid $default-border-color;
        border-radius: $border-radius-base;
        padding: 8px;
        box-shadow: 0 2px 8px $default-box-shadow-color;
        z-index: 10;

        &-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        &-weekdays {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            margin-bottom: 4px;

            .weekday {
                text-align: center;
                font-weight: bold;
            }
        }

        &-days {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 4px;

            .day {
                text-align: center;
                padding: 4px;
                cursor: pointer;
                border-radius: $border-radius-base;

                &.selected {
                    background: #3498db;
                    color: $white;
                }

                &:hover:not(.empty) {
                    background: #f5f5f5;
                }

                &.empty {
                    cursor: default;
                }
            }
        }
    }
}

// 上传组件样式
.upload {
    input[type="file"] {
        display: none;
    }

    .upload-btn {
        padding: 8px 16px;
        background: #f5f5f5;
        border: 1px dashed $default-border-color;
        cursor: pointer;
        @include transition-all;

        &:hover {
            background: lighten(#f5f5f5, 5%);
        }
    }
}

// 评分组件样式
.rating {
    .star {
        font-size: 24px;
        color: #ccc;
        cursor: pointer;
        @include transition-all;

        &.active {
            color: #ffc107;
        }
    }
}

// 时间选择器样式
.time-picker {
    position: relative;

    .time-input {
        padding: 8px;
        border: 1px solid $default-border-color;
    }

    .time-panel {
        position: absolute;
        top: 100%;
        left: 0;
        background: $white;
        border: 1px solid $default-border-color;
        padding: 8px;
        z-index: 10;

        .time-selector {
            display: flex;
            align-items: center;
            gap: 8px;

            select {
                padding: 4px;
            }
        }
    }
}

// 颜色选择器样式
.color-picker {
    display: inline-flex;
    align-items: center;

    .color-preview {
        width: 24px;
        height: 24px;
        border: 1px solid $default-border-color;
        cursor: pointer;
        @include transition-all;
    }

    input[type="color"] {
        margin-left: 8px;
    }
}

// 开关组件样式
.switch {
    width: 40px;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;

    &.active {
        background: #4CAF50;
    }

    .switch-handle {
        position: absolute;
        top: 2px;
        left: 2px;
        width: 16px;
        height: 16px;
        background: $white;
        border-radius: 50%;
        transition: transform 0.3s;
    }

    &.active .switch-handle {
        transform: translateX(20px);
    }
}

// Toast样式
.toast {
    position: fixed;
    padding: 12px 24px;
    border-radius: $border-radius-base;
    background: #333;
    color: $white;
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 9998;

    // 位置样式
    &-top {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

    &-top-left {
        top: 20px;
        left: 20px;
    }

    &-top-right {
        top: 20px;
        right: 20px;
    }

    &-bottom {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
    }

    &-bottom-left {
        bottom: 20px;
        left: 20px;
    }

    &-bottom-right {
        bottom: 20px;
        right: 20px;
    }

    &-center {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    // 类型样式
    &.success {
        background: #4CAF50;
    }

    &.error {
        background: #f44336;
    }

    &.info {
        background: #2196F3;
    }
}

// Spinner样式
.spinner {
    display: inline-flex;
    gap: 8px;

    &-dot {
        width: 10px;
        height: 10px;
        background: #333;
        border-radius: 50%;
        animation: spinner 1.4s infinite ease-in-out;

        &:nth-child(1) {
            animation-delay: -0.32s;
        }

        &:nth-child(2) {
            animation-delay: -0.16s;
        }
    }
}

@keyframes spinner {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

// Tabs样式
.tabs {
    &-header {
        display: flex;
        border-bottom: 1px solid $default-border-color;
    }

    .tab-header {
        padding: 8px 16px;
        cursor: pointer;
        @include transition-all;

        &.active {
            border-bottom: 2px solid #2196F3;
        }
    }

    &-content {
        padding: 16px;
    }
}

// 通知组件样式
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: $border-radius-base;
    background: #333;
    color: $white;
    box-shadow: 0 2px 10px $default-box-shadow-color;
    opacity: 1;
    transition: opacity 0.3s;
    z-index: 9998;

    &.success {
        background: #4CAF50;
    }

    &.error {
        background: #f44336;
    }

    &.info {
        background: #2196F3;
    }
}

// 加载组件样式
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.tree {
    padding-left: 20px;
}

.tree-node-container {
    margin-left: 20px;
}

.tree-children {
    list-style-type: none;
    padding-left: 20px;
}

.tree-node {
    margin: 5px 0;
}

.hidden {
    display: none;
}

.floating-component {
    position: fixed;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    // 可根据需求调整悬浮组件的位置
    bottom: 20px;
    right: 20px;

    // 悬浮组件内容区域
    .floating__content {
        padding: 16px;
        background-color: #fff;
        color: #333;
        font-size: 14px;
        line-height: 1.5;
    }

    // 悬浮组件头部区域
    .floating__header {
        padding: 12px 16px;
        background-color: #f5f5f5;
        border-bottom: 1px solid #e8e8e8;
        font-weight: 600;
        font-size: 16px;
    }
}

.slider {
    position: relative;
    height: 4px;
    margin: 16px 0;
    cursor: pointer;

    &__track {
        position: relative;
        height: 100%;
        background-color: #e5e5e5;
        border-radius: 2px;
    }

    &__progress {
        position: absolute;
        height: 100%;
        background-color: #1989fa;
        border-radius: 2px;
        transition: width 0.2s;
    }

    &__button {
        position: absolute;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 16px;
        height: 16px;
        background-color: #fff;
        border: 2px solid #1989fa;
        border-radius: 50%;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        transition: left 0.2s;

        &.dragging {
            box-shadow: 0 0 0 4px rgba(25, 137, 250, 0.2);
        }
    }

    &.disabled {
        cursor: not-allowed;

        & .slider__track {
            background-color: #f0f0f0;
        }

        & .slider__progress {
            background-color: #cccccc;
        }

        & .slider__button {
            border-color: #cccccc;
            background-color: #f5f5f5;
        }
    }
}

.search {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f2f2f2;

    &__input-container {
        flex: 1;
        display: flex;
        align-items: center;
        background-color: #fff;
        border-radius: 4px;
        padding: 5px 10px;
    }

    &__icon {
        width: 20px;
        margin-right: 5px;
        background-image: url('path/to/search-icon.png');
        background-size: cover;
    }

    &__input {
        flex: 1;
        border: none;
        outline: none;
        font-size: 14px;
    }

    &__clear {
        width: 20px;
        margin-left: 5px;
        background-image: url('path/to/clear-icon.png');
        background-size: cover;
        cursor: pointer;
    }

    &__cancel {
        margin-left: 10px;
        border: none;
        background: none;
        color: #07c160;
        font-size: 14px;
        cursor: pointer;
    }

    &.disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }
}

.radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;

    &__input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

    &__icon {
        width: 18px;
        height: 18px;
        border: 1px solid #ccc;
        border-radius: 50%;
        margin-right: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;

        &::after {
            content: '';
            width: 10px;
            height: 10px;
            background-color: transparent;
            border-radius: 50%;
            transition: all 0.2s;
        }
    }

    &.checked {
        .radio__icon {
            border-color: #1989fa;
            background-color: #1989fa;

            &::after {
                background-color: #fff;
            }
        }
    }

    &.disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }

    &__label {
        font-size: 14px;
    }
}

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;

    &.hidden {
        display: none;
    }
}

.dialog-container {
    background-color: #fff;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    overflow: hidden;
}

.dialog-title {
    padding: 16px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
}

.dialog-content {
    padding: 16px;
    font-size: 14px;
}

.dialog-footer {
    display: flex;
    border-top: 1px solid #eee;
}

.dialog-cancel,
.dialog-confirm {
    flex: 1;
    padding: 12px;
    border: none;
    background-color: transparent;
    font-size: 14px;
    cursor: pointer;
}

.dialog-cancel {
    border-right: 1px solid #eee;
    color: #666;
}

.dialog-confirm {
    color: #1989fa;
}

.dropdown-menu {
    position: relative;
}

.dropdown-menu__header {
    display: flex;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.dropdown-menu__item {
    flex: 1;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    position: relative;

    &.active {
        color: #1989fa;

        .dropdown-menu__icon {
            transform: rotate(180deg);
        }
    }
}

.dropdown-menu__title {
    margin-right: 4px;
}

.dropdown-menu__icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
    transform: rotate(45deg);
    transition: transform 0.3s;
}

.dropdown-menu__mask {
    position: fixed;
    top: 44px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.dropdown-menu__content {
    background-color: #fff;
}

.dropdown-menu__option {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;

    &.selected {
        color: #1989fa;
        background-color: #f5f5f5;
    }
}

.floating-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 1000;

    &.hidden {
        display: none;
    }
}

.floating-panel {
    background-color: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.floating-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}

.floating-panel__title {
    font-size: 18px;
    font-weight: bold;
}

.floating-panel__close {
    border: none;
    background: none;
    font-size: 24px;
    cursor: pointer;
}

.floating-panel__content {
    padding: 16px;
    font-size: 14px;
}

.floating-panel__actions {
    display: flex;
    padding: 16px;
    border-top: 1px solid #eee;
}

.floating-panel__action {
    flex: 1;
    padding: 12px;
    margin: 0 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.floating-panel__action:first-child {
    margin-left: 0;
}

.floating-panel__action:last-child {
    margin-right: 0;
}

.badge-container {
    position: relative;
    display: inline-block;
}

.badge {
    position: absolute;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background-color: #ee0a24;
    border-radius: 8px;
}

.badge.is-dot {
    width: 8px;
    min-width: 0;
    height: 8px;
    padding: 0;
    border-radius: 50%;
}

.badge-top-right {
    top: -4px;
    right: -4px;
}

.demo-btn {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.demo-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: #ccc;
    border-radius: 4px;
}

.demo-text {
    font-size: 14px;
    color: #333;
}

.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #969799;
    font-size: 14px;
    line-height: 20px;

    &::before,
    &::after {
        flex: 1;
        border-top: 1px solid #ebedf0;
        content: '';
    }

    &--hairline {

        &::before,
        &::after {
            transform: scaleY(0.5);
        }
    }

    &--dashed {

        &::before,
        &::after {
            border-style: dashed;
        }
    }

    &--left {
        &::before {
            margin-right: 10px;
            flex: 0.2;
        }

        &::after {
            margin-left: 10px;
        }
    }

    &--center {
        &::before {
            margin-right: 10px;
        }

        &::after {
            margin-left: 10px;
        }
    }

    &--right {
        &::before {
            margin-right: 10px;
        }

        &::after {
            margin-left: 10px;
            flex: 0.2;
        }
    }

    &__content {
        padding: 0 10px;
    }
}

.skeleton {
    display: flex;
    padding: 16px;
}

.skeleton__avatar {
    width: 40px;
    height: 40px;
    background-color: #f2f3f5;
    margin-right: 16px;
    border-radius: 4px;
}

.skeleton__avatar--round {
    border-radius: 50%;
}

.skeleton__content {
    flex: 1;
    min-width: 0;
}

.skeleton__title {
    width: 40%;
    height: 16px;
    background-color: #f2f3f5;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton__title--round {
    border-radius: 8px;
}

.skeleton__paragraph-line {
    width: 100%;
    height: 14px;
    background-color: #f2f3f5;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton__paragraph-line--round {
    border-radius: 8px;
}

.skeleton--animated {
    position: relative;
    overflow: hidden;

    &::after {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        background-image: linear-gradient(90deg,
                rgba(255, 255, 255, 0) 0,
                rgba(255, 255, 255, 0.2) 20%,
                rgba(255, 255, 255, 0.5) 60%,
                rgba(255, 255, 255, 0));
        animation: skeleton-loading 1.5s infinite;
        content: "";
    }
}

@keyframes skeleton-loading {
    100% {
        transform: translateX(100%);
    }
}

.steps {
    font-size: 14px;
    color: #969799;

    &--horizontal {
        display: flex;
    }

    &--vertical {
        .step {
            display: flex;
        }

        .step__head {
            margin-right: 16px;
        }

        .step__line {
            height: 20px;
            width: 1px;
            margin: 4px auto 0;
        }
    }
}

.step {
    position: relative;
    flex: 1;

    &--finish {
        .step__icon {
            border-color: #07c160;
            background-color: #07c160;
            color: #fff;
        }

        .step__title,
        .step__description {
            color: #07c160;
        }
    }

    &--process {
        .step__icon {
            border-color: #07c160;
            color: #07c160;
        }

        .step__title,
        .step__description {
            color: #323233;
        }
    }

    &--wait {
        .step__icon {
            border-color: #969799;
            color: #969799;
        }
    }
}

.step__head {
    position: relative;
    flex-shrink: 0;
}

.step__icon {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    border: 2px solid;
    border-radius: 50%;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
}

.step__line {
    position: absolute;
    top: 9px;
    left: 50%;
    right: -50%;
    height: 2px;
    background-color: #ebedf0;
    transform: translateX(-50%);
}

.step__main {
    padding-top: 8px;
}

.step__title {
    font-weight: 500;
    color: #323233;
}

.step__description {
    margin-top: 4px;
    font-size: 12px;
}

.swipe {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 200px;
}

.swipe__track {
    display: flex;
    width: 100%;
    height: 100%;
}

.swipe__item {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
}

.swipe__indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.swipe__indicator {
    width: 8px;
    height: 8px;
    margin: 0 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
}

.swipe__indicator.active {
    background-color: #fff;
}

.swipe-content {
    font-size: 18px;
    color: #333;
}

.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background-color: #fff;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.1);
    height: 50px;
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #969799;
    cursor: pointer;
}

.tabbar-item.active {
    color: #1989fa;
}

.tabbar-item__icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.tabbar-item__text {
    font-size: 12px;
}

.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    height: 44px;
    background-color: #fff;
    border-bottom: 1px solid #ebedf0;
    z-index: 1000;
}

.nav-bar__left,
.nav-bar__right {
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 14px;
    color: #1989fa;
    cursor: pointer;
}

.nav-bar__left {
    flex: 1;
    justify-content: flex-start;
}

.nav-bar__right {
    flex: 1;
    justify-content: flex-end;
}

.nav-bar__arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-left: 2px solid #1989fa;
    border-bottom: 2px solid #1989fa;
    transform: rotate(45deg);
    margin-right: 5px;
}

.nav-bar__title {
    flex: 2;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #323233;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.back-top {
    position: fixed;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;

    &.hidden {
        display: none;
    }
}

.back-top__icon {
    width: 16px;
    height: 16px;
    color: #ffffff;
    font-weight: 700;
}

.swipe {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 200px;
}

.swipe-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.swipe-item {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background-color: #cccccc;
}

.swipe-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
}

.swipe-indicator {
    width: 6px;
    height: 6px;
    border-radius: 100%;
    background-color: rgba(0, 0, 0, 0.3);
}

.swipe-indicator.active {
    background-color: #1989fa;
}

// 在文件合适位置添加（建议在文件末尾）
.x-space {
    // 基础布局
    display: inline-flex;
    vertical-align: middle;

    // 处理旧浏览器兼容
    &--fallback {
        margin: calc(-1 * var(--spacer) / 2);

        .x-space__item {
            margin: calc(var(--spacer) / 2);
        }
    }

    // 子项通用样式
    &__item {
        display: flex;
        align-items: center;
    }

    // 响应式处理
    @media (max-width: 768px) {
        &--mobile-wrap {
            flex-wrap: wrap !important;

            .x-space__item {
                margin-bottom: 8px;
            }
        }
    }

    // 分隔符样式
    &__split {
        color: #c0c4cc;
        padding: 0 8px;
    }
}

// 添加在全局变量区域
:root {
    --spacer: 8px; // 默认间距变量
}

.x-image {
    position: relative;
    transition: transform 0.3s ease;

    &__placeholder {
        &::after {
            content: "Loading...";
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
    }

    &__error {
        &::after {
            content: "✖";
            margin-left: 5px;
        }
    }

    &:hover {
        transform: scale(1.02);
    }
}

.x-dropdown {
    position: relative;
    display: inline-block;

    &-menu {
        position: absolute;
        min-width: 120px;
        background: #fff;
        border: 1px solid #ebeef5;
        box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
        opacity: 0;
        transition: opacity 0.3s;

        &.visible {
            opacity: 1;
        }
    }

    &-item {
        padding: 8px 16px;
        cursor: pointer;

        &:hover {
            background: #f5f7fa;
        }

        &.is-disabled {
            color: #c0c4cc;
            cursor: not-allowed;
        }

        &.is-divided {
            border-top: 1px solid #ebeef5;
        }
    }
}